Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XMega AVRISP2 #178

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open

XMega AVRISP2 #178

wants to merge 30 commits into from

Conversation

masterxq
Copy link

@masterxq masterxq commented Dec 4, 2021

Hi Dean,
we have a small hackerspace and our members have build some programmers based on xmega for programming some microcontrollers. We want to extend the functionality to also be able to program avr based microcontrollers.
So we forked your software and trying to get the Project AVRISP-MKII work on the XMEGA. I think we allready did a lot, but we have trouble to complete it.
I really wish i could make a pull request for a branch of your project. Every change is forked on ARCH... Except the makefile. If you want to accept this pull request you possibly will need to change the ARCH in the makefile back to AVR8 and check the AppConfig.h. Then it should be ok to merge to master, even if our code is not completed it will not break the current functionality.
The current status of XMEGA support is:
It compiles and will be detectected as AVRISP mkII. But we can not program over PDI. SPI is still untested.

We want to ask for your help.

  1. We have trouble with debugging (leak of tools and knowledge) so we don't know exactly what the problems are.
  2. We can do more Task, but currently we are not sure what to do. If you can give us specs will just implement things.
  3. We created the function Endpoint_SetEndpointDirection, this needs to be checked and should maybe be modified, its just a guess about how to do.

You can just merge the code under your name and your licence. We just want is to get it work and learn something :)

Please drop some words, also if you have no time for help. So we know we need to continue alone :)

Thanks that we may use your your amazing code!

@masterxq
Copy link
Author

masterxq commented Dec 6, 2021

We can now read signature and fuses via PDI, then USB crashes while trying to read the memory. We get the answer 0xd9 0xc9 from the device and expecting something like 0x50 0x05 0x00... We will continue with SPI as soon PDI works.

But ok something working ^^

@masterxq
Copy link
Author

Hi,
PDI is now woking fine! We also found an critical bug related to #172. Length check was broken, even if you still don't want to merge you should fix this. The programming of the XMega is not possible with your current length check...
We also compared our PDI implementation on a logic analyzer to the orignal AVRISP II PDI signal. Everything looks great!
Really nice to have this finally working :)

Regards the HTV Group!

@masterxq
Copy link
Author

Now SPI works too. Verified with programming an atmega328p. Lowerest clk rate not possible with SPI module but could be reached with USART in SPI Master mode. But i think it's fine as it is.
Not tested with avr8 as programmer.

@masterxq
Copy link
Author

masterxq commented Jan 19, 2022

Hi Dean, if there are some modifications you need before you can merge, you have to tell us soon. Because the device is now working as we wish and we are going to forget details and losing the focus on this project.

There are following limitations:

  • We have no TPI device for testing
  • We have no official Atmel boards for testing
  • We have no PC with windows

But we have:

  • custom XMega boards
  • Original AVRISP2
  • Arduino board with mega328p
  • a logic analyzer
  • DSO

Compare with the orignal AVRISP2 is done for ISP and PDI.

Of cause you are welcome to modify our PR yourself or make a PR against our git. We can test your modifications and report back.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant